# Docker image for springboot application
FROM openjdk:17-jdk-slim AS runtime
WORKDIR /app
ARG JAR_FILE=target/platform-admin.jar
COPY ${JAR_FILE} ./app.jar

EXPOSE 18080
ENV DOCKER true
ENV TZ=Asia/Shanghai
ENV JAVA_OPTS="-XX:+UseG1GC -Xms1024m -Xmx1024m -Xss256k -XX:MetaspaceSize=128m"

# 时区
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# 启动
ENTRYPOINT ["java","-jar","./app.jar", "${JAVA_OPTS}", "-Dfile.encoding=UTF-8"]
CMD ["--spring.profiles.active=test"]